<?php
include("db/connect.php");
$sqlselectemployee="select * from employee,province,amphur,tambol";
$sqlselectemployee.=" where employee.province_id=province.province_id and";
$sqlselectemployee.=" employee.amphur_id=amphur.amphur_id and";
$sqlselectemployee.=" employee.tambol_id=tambol.tambol_id and";
$sqlselectemployee.=" emp_id like '%".$_POST["txtsearch"]."%' group by emp_id";
$queryselectemployee=mysql_query($sqlselectemployee);
?>
<table width="100%" height="132" border="1">
  <tr>
    <td width="8%">ชื่อ</td>
    <td width="7%">นามสกุล</td>
    <td width="5%">ที่อยู่</td>
    <td width="5%">ตำบล</td>
    <td width="6%">อำเภอ</td>
    <td width="6%">จังหวัด</td>
    <td width="11%">รหัสไปรษณีย์</td>
    <td width="11%">เบอร์โทรศัพท์</td>
    <td width="5%">Email</td>
    <td width="5%">แก้ไข</td>
    <td width="9%">ลบ</td>
  </tr>
  <?php 
  while($resultemployee=mysql_fetch_array($queryselectemployee)){
  ?>
  <tr>
    <td><?php echo $resultemployee["emp_name"]?></td>
    <td><?php echo $resultemployee["emp_lastname"]?></td>
    <td><?php echo $resultemployee["emp_addr"]?></td>
    <td><?php echo $resultemployee["tambol_name"]?></td>
    <td><?php echo $resultemployee["amphur_name"]?></td>
    <td><?php echo $resultemployee["province_name"]?></td>
    <td><?php echo $resultemployee["emp_postal"]?></td>
    <td><?php echo $resultemployee["emp_tel"]?></td>
    <td><?php echo $resultemployee["emp_mail"]?></td>
    <td><a href="Javascript:ajaxmanage(2,<?php echo $resultemployee["emp_id"];?>);">แก้ไข</a></td>
    <td><a href="Javascript:ajaxmanage(1,<?php echo $resultemployee["emp_id"];?>);">ลบ</a></td>
  </tr>
  <?php }?>
</table>